package org.lion.jingbeifang_interviewquestions.calculatePrice.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import org.lion.jingbeifang_interviewquestions.calculatePrice.enums.GoodsItem;

import java.math.BigDecimal;

@Data
public class Goods {

    private GoodsItem goodsItem;

    private int weight;

    private StrategyDiscount discount;



    public Goods(GoodsItem goodsItem, int weight, StrategyDiscount discount){
        if (weight < 0 ){
            throw new ArithmeticException("The weight must be greater than 0!");
        }
        this.goodsItem = goodsItem;
        this.weight = weight;
        this.discount = discount;
    }






}
